package com.jiyun.admin.controller;

import com.jiyun.admin.service.OssService;
import com.spyx.common.result.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/oss/fileoss")
public class OssController {

    @Autowired
    private OssService ossService;

    @PostMapping
    public ResponseResult uploadFile(@RequestParam("file") MultipartFile file) {
        String url = ossService.uploadFileAvatar(file);
        return ResponseResult.success(url);
    }
}
